import { message as http } from '@zh/common-utils/http'

/**
 * 分页查询
 * @param {Object} params
 */
export function page (params) {
  return http.post('/message/SysAnnouncement/page', params)
}

/**
 * 修改或保存
 * @param {Object} params
 */
export function saveOrUpdate (data) {
  const url = '/message/SysAnnouncement/saveOrUpdate'
  return http.post(url, data)
}

/**
 * 删除
 * @param {String} id
 */
export function del (id) {
  return http.get('/message/SysAnnouncement/delete/' + id)
}

/**
 * 根据角色ID查询角色
 * @param {String} id
 */
export function getById (id) {
  return http.get('/message/SysAnnouncement/getById/' + id)
}
/**
 * 根据公告id查询单位权限
 * @param {String} id
 */
export function queryUnit (id) {
  return http.get('/message/SysAnnouncementUnit/queryUnit/' + id)
}
/**
 * 通知公告分页查询
 */
export function getAnouncementPage (param) {
  return http.post('message/SysAnnouncement/allpage', param)
}